<?php
  /***************************************************************
   * @file: html_helper.php
   * @author: Neo
   * @mail: xq262144@gmail.com
   * @date: 
   * @description:
   * this file is the html helper technic of this framework
   ***************************************************************/
   
  if (!defined('SYS_BASEPATH')) {echo "No script access allowed!"; header("HTTP/1.0 404 Not Found"); } 
  
  function css_tag($css_name) {
    echo '<link rel="stylesheet" href="' . SYS_CSS . "/$css_name" . '" type="text/css" />';     
  }
  
  function js_tag($js_name = null, $inline_js = null) {
    echo '<script type="text/javascript" ';

    if (!empty($js_name))
        echo 'src="' . SYS_JS . "/$js_name" . '"';
    echo ">";
    if (!empty($inline_js))
        echo "//<!--<![CDATA[\n$inline_js\n//]]>-->\n";
    echo '</script>';
  }
  
  function img_tag($img_name, $info_array = null) {
     echo '<img src="' . SYS_IMAGE . "/$img_name" . '" ';
     if ($info_array != null) {
       foreach($info_array as $info => $value)
         echo "${info}=\"${value}\" ";  
     }
     echo " />";
  }